<ion-header>
    <ion-toolbar>
        <ion-title>login</ion-title>
    </ion-toolbar>
</ion-header>

<ion-content>
    <ion-avatar class="logo">
        <img src="assets/image/head_default.jpg">
    </ion-avatar>
    <ion-list>
        <ion-item>
            <ion-label>用户名：</ion-label>
            <ion-input type="text" placeholder="由字母、数字、下划线组成" [(ngModel)]="username" (ionChange)="onChange(1)" (ionBlur)="onBlur()"></ion-input>
        </ion-item>
        <ion-item>
            <ion-label>密&emsp;码：</ion-label>
            <ion-input type="password" placeholder="6-20位数字或字母" [(ngModel)]="password" (ionChange)="onChange(2)" (ionBlur)="onBlur()"></ion-input>
        </ion-item>
    </ion-list>
    <ion-label *ngIf="errorMsg" class="error-message"> {{errorMsg}} </ion-label>
    <ion-button class="login" (click)="onLogin()" color="primary" fill="solid" size="default" type="button" expand="block" [disabled]='!status'> 登录</ion-button>
    <ion-button (click)="toRegister()" class="register" color="primary" fill="clear" size="default" type="button" expand="block"> 注册</ion-button>
</ion-content>